package learnmath.windows.apps{
/*-------------------------------------------------------------
	Created by: Ionel Alexandru 
	Mail: ionel.alexandru@gmail.com
	Site: www.learn-math.info
---------------------------------------------------------------*/
import learnmath.mathml.graph.*;
import learnmath.windows.elements.*;
import learnmath.windows.menu.*;
import learnmath.windows.*;
import flash.display.*;
import fl.containers.*;
import flash.net.*;

public class XmlEditorApp extends WindowXP{

	var graph:MovieClip;
	var graphWorkspace:GraphWorkspace;
	public var workingPannel:ScrollPane;
	
	var workingPannelW;
	var workingPannelH;
	

	public function XmlEditorApp(_windowsManager:WindowsManager, parent:MovieClip, _littleIcon:MovieClip, _name:String, _id:String, x:int, y:int, _width:int, _height:int, _graphMC:String){
		super(_windowsManager, parent, _littleIcon, _name, _id, x, y, _width, _height);
	}
	
	public override function redrawWorkingPannel():void {
		workingPannelW = width-7;
		workingPannelH = height-43;

		var menuBar:MenuBar = new MenuBar();
		var m1:MenuGroup = new MenuGroup("File", "menu_file");
		m1.addMenuList(new MenuItem("New", "menu_file_new"));
		m1.addMenuList(new MenuItem("Open...", "menu_file_open"));

		var mw:MenuGroup = new MenuGroup("Workspace", "menu_workspace")
		mw.addMenuList(new MenuItem("Open...", "menu_workspace_open"));
		mw.addMenuList(new MenuItem("Close", "menu_workspace_close"));

		m1.addMenuList(mw);
		
		m1.addMenuList(new MenuItem("Close", "menu_file_close"));
		menuBar.addMenuList(m1);
		
		
		var m2:MenuGroup = new MenuGroup("Edit", "menu_edit");
		m2.addMenuList(new MenuItem("Undo", "menu_edit_undo"));
		m2.addMenuList(new MenuItem("Redo", "menu_edit-redo"));
		menuBar.addMenuList(m2);

		var m3:MenuGroup = new MenuGroup("Search", "menu_search");
		menuBar.addMenuList(m3);
		var m4:MenuGroup = new MenuGroup("View", "menu_view");
		menuBar.addMenuList(m4);
		var m5:MenuGroup = new MenuGroup("Tools", "menu_tools");
		menuBar.addMenuList(m5);
		
		var menuBarPannel:MenuBarPannel = MenuManager.createMenu(pannel, menuBar, workingPannelW);
		menuBarPannel.pannel.addEventListener(MenuCustomEvent.EXECUTE, executeMenu);

		menuBarPannel.pannel.x = 3;
		menuBarPannel.pannel.y = 21;
		
		pannel.graphics.lineStyle(1,0x847f7b);
		pannel.graphics.moveTo(0,41);
		pannel.graphics.lineTo(width-1, 41);
		pannel.graphics.lineStyle(1,0xffffff);
		pannel.graphics.moveTo(0,42);
		pannel.graphics.lineTo(width-1, 42);
		
		
	}

	private function executeMenu(event:MenuCustomEvent):void {
		trace("event:" + event.menuId);
	}
	
	public override function drawOnFrame():void {
	}

}
}